package com.company;

public class TaxiCharging_YFQ {
    public static double calculateFare(double distance, int waitingTime) {
        double fare;
        if (distance <= 8) {
            fare = distance * 0.8;
        } else {
            fare = 8 * 0.8 + (distance - 8) * 0.8 * 1.5;
            fare += (distance - 8) * 0.8 * 0.5;
        }
        fare += waitingTime * 0.25;
        return fare;
    }
}
